package com.lixia.lxframework.framework.system.ex;


import static com.lixia.lxframework.framework.system.constant.MsgConstants.FAILED_CODE;

/**
 * @author Mr.wang
 * @功能描述 业务异常处理
 * @日期 2019/3/4
 */
public class BusinessException extends RuntimeException {

    private int code;

    public BusinessException(String message) {
        super(message);
        this.code = FAILED_CODE;
    }

    public BusinessException(String message, Exception e) {
        super(message);
        super.addSuppressed(e);
        this.code = FAILED_CODE;
    }

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(int code, Exception e) {
        this.code = code;
        super.addSuppressed(e);
    }

    public BusinessException(int code, String message, Exception e) {
        super(message);
        this.code = code;
        super.addSuppressed(e);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
